<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2面翻转的盒子</title>
    <style>
        .box {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 100px auto;
            transition: all 0.6s;
            /* 让子盒子保留3D立体空间*/
            transform-style: preserve-3d;
        }

        .box:hover {
            transform: rotateY(180deg);
        }

        .front,
        .back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            font-size: 30px;
            color: #fff;
            text-align: center;
            line-height: 300px;
        }

        .front {
            background-color: #b7eb8f;
        }

        .back {
            background-color: #00a4ff;
            transform: rotateY(180deg);
        }
    </style>
</head>
<body>

<div class="box">
    <div class="front">我是正面</div>
    <div class="back">我是反面</div>
</div>
</body>
</html>